<div class="success clearfix">
  <div class="span-1 pic"/></div>
  <div class="span-10"><h3><{t}>Congratulations Registered Member<{/t}></h3></div>
  
</div>
<div class="FormWrap">
<div class="customMessages">{reg_succ_mess}</div>

<form method="post" action="<{link ctl="member" act="saveMember"}>" id='form_saveMember_info' class="section">
<input type="hidden" name="is_register" value=1>
<input type="hidden" name="plugUrl" class="inputstyle" value="<{$plugUrl}>">
<div class="division" id='crateAdmin'>
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="forform">
  <{foreach from=$tree item=item name="item" key='row'}>
  <tr>
  <th><{if $item.attr_required eq 'true'}><em>*</em><{/if}><{$item.attr_name}></th>
  <td>  <{if $item.attr_type =='date'}>
  <{input class="cal" type='date' name='birthday'}>
  <{/if}>
 
  <{if $item.attr_type =='text'}>
   <input class='inputstyle _x_ipt' name='<{$item.attr_id}>' vtype='<{if $item.attr_required eq 'true'}>required&&<{/if}><{$item.attr_valtype}>' type='text'/>
  <{/if}>
    <{if $item.attr_type =='cal'}>
  <{input class="cal" type='date' name=$item.attr_id required=$item.attr_required}>
  
  <{/if}>
  
  
  
   <{if $item.attr_group =='defalut' && $item.attr_type != 'area' && $item.attr_type != 'sex' && $item.attr_type != 'date'}>
  <input type='text' name='<{$item.attr_type}>' class="inputstyle _x_ipt" required='<{$item.attr_required}>'>
  <{/if}>
  
  
   <{if $item.attr_type =='area'}> 
   <{input type="region" name='area' vtype='area2'}>

      <script>
     addEvent('domready',function(){
		 validatorMap.set('area2',['Choose the area you do not complete',function(el,v){
				 var els=el.getElements('select');
				 if(els.length==1&&(els[0].getValue()==''||els[0].getValue()=='_NULL_')){
					 return true;
				 }else{
				   return els.every(function(sel){
								  var selValue=sel.getValue();
								  var v=selValue!=''&&selValue!='_NULL_';
								  if(!v){
								      sel.focus();
									  return false;
								  }
								  return true;
							 });
				 }
				 return true;
			 }
		   ]);
	   });
	  </script>
   <{/if}>
   
   <{if $item.attr_type =='sex'}>
  <input type='radio' name='sex' value='1'><label><{t}>male<{/t}></label>
  <input type='radio' name='sex' value='0'><label><{t}>female<{/t}></label>
   <{/if}>
   
   <{if $item.attr_type =='select'}>
 <select name='<{$item.attr_id}>' <{if $item.attr_required eq 'true'}>class='_x_ipt' vtype='required'<{/if}>>
 <option value=''><{t}>- select -<{/t}></option>
 <{foreach from=$item.attr_option item=option name="option"  }>
 <option value='<{$option}>'><{$option}></option>
 <{/foreach}>
 </select>
   <{/if}>
   
  <{if $item.attr_type =='checkbox'}>
 
 <{foreach from=$item.attr_option item=checkbox name="checkbox" }>
 
 <input type='checkbox' name=<{$item.attr_id}>[]" value='<{$checkbox}>' ><label><{$checkbox}></label><br/>
 
 <{/foreach}>
<{if $item.attr_required eq 'true'}><input type='hidden' class='_x_ipt' vtype='selectc'/><{/if}>
   <{/if}></td>
  </tr>
  <{/foreach}><tr>
    <th></th>
    <td><input  type="submit" class="buttonstyle" value="OK" />
  </tr> 
  </table>
</form>
</div>
</div>


<script>

window.addEvent('domready',function(){
validatorMap.set('selectc',['This item required',function(element,value){
 
    var checkboxelement = element.getParent('td').getElements('input[name$=]]');
    var flag=checkboxelement.some(function(i){
	  return !!i.checked;
	});
	checkboxelement.addEvent('change',function(){
		validator.removeCaution(element);
		validator.test($('crateAdmin'),element);
		checkboxelement.removeEvent('change',arguments.callee);
	});
	return flag;
}])});
</script>